package com.xishu.entity.shop;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.dao.NotModify;
import com.xishu.bo.RowAndColumn;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.ShopItem;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

/**
 * 餐桌的配置
 */
@Table(indexes = {@Index(columnList = "shopId")})
@Entity(name = "food_table_config")
public class FoodTableConfig extends ShopItem {
    private static final long serialVersionUID = 4364334116692150517L;

    @ApiModelProperty(value = "餐厅公司的ID")
    private Long companyId;

    @ApiModelProperty(value = "分店的ID")
    private Long shopId;

    @ApiModelProperty(value = "配置的名称")
    private String name;

    @ApiModelProperty(value = "设置开始序号")
    @Transient
    private Integer startIndex;

    @ApiModelProperty(value = "排序方式，1是横向，2是纵向")
    @Transient
    private Integer arrangeSortType;

    @ApiModelProperty(value = "餐桌类型，比A,B,C,D这种，FoodTableTypeConfig里面的code值")
    private String code;

    @ApiModelProperty(value = "最大人数")
    private Integer maxPerson;

    @ApiModelProperty(value = "客户端已选中的行和列的列表")
    @Transient
    @FieldMapping(desField = "rowAndColumnListJson", serialize = true)
    private List<RowAndColumn> rowAndColumnList;

    @ApiModelProperty(value = "客户端已选中的行和列的列表")
    @FieldMapping(desField = "rowAndColumnList", serialize = false, genericType = "com.xishu.bo.RowAndColumn")
    @Lob
    @Column(columnDefinition="MEDIUMTEXT")
    private String rowAndColumnListJson;

    @ApiModelProperty(value = "场景ID")
    private Long sceneId;

    @Transient
    @ApiModelProperty(value = "是否删除操作")
    private Boolean deleteOperate;

    @ApiModelProperty(value = "索引值")
    @NotModify
    private Integer showIndex;

    public Integer getShowIndex() {
        return showIndex;
    }

    public void setShowIndex(Integer showIndex) {
        this.showIndex = showIndex;
    }

    public Boolean getDeleteOperate() {
        return deleteOperate;
    }

    public void setDeleteOperate(Boolean deleteOperate) {
        this.deleteOperate = deleteOperate;
    }

    public Long getSceneId() {
        return sceneId;
    }

    public void setSceneId(Long sceneId) {
        this.sceneId = sceneId;
    }

    public Integer getMaxPerson() {
        return maxPerson;
    }

    public void setMaxPerson(Integer maxPerson) {
        this.maxPerson = maxPerson;
    }

    public List<RowAndColumn> getRowAndColumnList() {
        return rowAndColumnList;
    }

    public void setRowAndColumnList(List<RowAndColumn> rowAndColumnList) {
        this.rowAndColumnList = rowAndColumnList;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(Integer startIndex) {
        this.startIndex = startIndex;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getArrangeSortType() {
        return arrangeSortType;
    }

    public void setArrangeSortType(Integer arrangeSortType) {
        this.arrangeSortType = arrangeSortType;
    }

    public String getRowAndColumnListJson() {
        return rowAndColumnListJson;
    }

    public void setRowAndColumnListJson(String rowAndColumnListJson) {
        this.rowAndColumnListJson = rowAndColumnListJson;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("FoodTableConfig{");
        sb.append("companyId=").append(companyId);
        sb.append(", shopId=").append(shopId);
        sb.append(", name='").append(name).append('\'');
        sb.append(", startIndex=").append(startIndex);
        sb.append(", arrangeSortType=").append(arrangeSortType);
        sb.append(", code='").append(code).append('\'');
        sb.append(", maxPerson=").append(maxPerson);
        sb.append(", rowAndColumnList=").append(rowAndColumnList);
        sb.append(", rowAndColumnListJson='").append(rowAndColumnListJson).append('\'');
        sb.append(", sceneId=").append(sceneId);
        sb.append(", deleteOperate=").append(deleteOperate);
        sb.append(", showIndex=").append(showIndex);
        sb.append(", id=").append(id);
        sb.append('}');
        return sb.toString();
    }
}
